Xbasic

A5_SHORTEN_FN Function

Syntax

Shortened_Filename as C = a5_shorten_fn(C filename [,N length ])

Arguments

Shortened_Filename

A shortened version of the a filename with "..." substituted for elements of the path.

filename

The original filename with full path information.

length

Numeric. Optional. Default = 30. The maximum number of characters to return.

Description

The A5_SHORTEN_FN() function shortens a filename to the specified number of characters by truncating the path and inserting "...". The default length is 30. The minimum returned will be the filename itself with all path information removed.

Example

fn = "C:\Program Files\A5V6\Samples\AlphaSports\AlphaSports.adb"
? a5_shorten_fn(fn)
= "C:\Program ...\AlphaSports.adb"
? a5_shorten_fn(fn,40)
= "C:\Program Files\A5V6...\AlphaSports.adb"
? a5_shorten_fn(fn,5)
= "AlphaSports.adb"

See Also